Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

331
Views
No "exports" main defined in C:\Users\node_modules\firebase\package.json

firebase config file.

here I am declaring my firebase configuration file, I am trying to initialize firebase firestore, database for one of my electron application, in the separate firebaseConfig.js file

const {initializeApp} = firebase;

const firebaseConfig = {
   setting all the configs here.. 

}

>here I am exporting the storage and db variables to be used in the main.js electron file where I have written a function to put the data to firebase

const storage = firebase.storage();
const db = firebase.firestore()
module.exports = storage;
module.exports = db;

main.js electron/node js file

below is the main.js file, where I am importing the variables that I have exported from the firebase config file

const storage = require('./firebase/firebaseconfig.js')
const db = require('./firebase/firebaseconfig.js');

function where firebase is being used, here I am supposed to use the storage and db variables that I have exported from the firebaseConfig file..

                    screenshot({format: 'png'})
                    .then((image)=>{
                        dns.lookup("www.google.com")
                        .then(()=>{
                           const uploadTask = storage.ref(`screenshots/${image.name}`).put(image);
                           uploadTask.on(
                               ()=>{
                                   storage
                                   .ref("screenshots")
                                   .child(image.name)
                                   .getDownloadURL()
                                   .then((url)=>{
                                    db.collection("screenshots").add({
                                        timestamp: firebase.firestore.FieldValue.serverTimestamp(),
                                        fieldName: image.name
                                    });
                                   })
                               } 
                           )
                        })
                        .catch(()=>{
                            fs.writeFile(path.join(myFolderPath, `new_screenshot_${counter}.png`),image, 
                            (err)=>{0
                                if(err){
                                    console.log(err)
                                }else{
                                    console.log('screenshot saved!');
                                    counter++;
                                }
                            });
                        })
                    })
                    .catch(err => console.log(err));
                }

now the problem is, with using firebase for node.js application.. I am being prompted with an error that states No "exports" main defined in C:\Users\screenshot_application\node_modules\firebase\package.json

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!